<h4>KEUANGAN &raquo; <span class="current_page">NERACA TAGIHAN</span></h4>

            <!-- Begin three column window -->
<div class="onecolumn" style="padding-bottom:20px">
    <div class="header">
    <span>DETAIL NERACA TAGIHAN</span>
	</div>
	<br class="clear"/>


<div class="content"> <br/>
<div class="text">
<p>
 <table class="data" width="100%" cellpadding="0" cellspacing="0">
           <thead align="center">
           <tr>
                <th width="34" height="40">No.</th>
                <th width="329">Nama Tagihan</th>
                <th width="81">Semester</th>
                <th width="70">Tahun</th>
                <th width="105">Debet</th>
                <th width="105">Kredit</th>
           </tr>
           </thead>
            <?php $total_tagihan = 0; ?>
            <?php $total_potongan = 0; ?>

            <?php if($dataNeraca): ?>

            <?php $seq_number =1; ?>
            <?php foreach($dataNeraca as $neraca): ?>

            <tr style="color:#000; background-color:#e5e6f5" align="center">
              <td height="23" align="right"><?php echo $seq_number; ?>.</td>
              <td align="left" style="padding-left:10px"><b><?php if($neraca->TAGIHAN) echo $neraca->TAGIHAN; else echo "&nbsp";  ?></b></td>
              <td><b><?php if($neraca->NAMA_SEMESTER) echo $neraca->NAMA_SEMESTER; else echo "&nbsp";  ?></b></td>
              <td><b><?php if($neraca->NAMA_TAHUN) echo $neraca->NAMA_TAHUN; else echo "&nbsp";  ?></b></td>
              <td>&nbsp;</td>
              <td align="right" style="padding-right:5px">&nbsp;</td>
            </tr>

            <?php $detail_tagihan = $this->siam_keuangan_model->detailTagihanAngsuran($this->session->userdata('siamunp_user'),$neraca->KODE_TAGIHAN,$neraca->KODE_TAHUN,$neraca->KODE_SEMESTER) ?>
            <?php if($detail_tagihan): ?>
              <?php foreach($detail_tagihan as $detag): ?>
              <tr style="color:#000">
                <td height="23" align="right">&nbsp;</td>
                <td align="left" style="padding-left:10px">&nbsp;&nbsp;&nbsp;<?php echo $detag->NAMA_TAGIHAN  ?></td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td align="right" style="padding-right:5px"><?php echo number_format($detag->JUMLAH,0,'','.'); ?></td>
                <?php $total_tagihan = $total_tagihan + $detag->JUMLAH; ?>
              </tr>
              <?php endforeach ?>
            <?php endif ?>

            <?php $detail_potongan = $this->siam_keuangan_model->detailPotonganAngsuran($this->session->userdata('siamunp_user'),$neraca->KODE_TAGIHAN,$neraca->KODE_TAHUN,$neraca->KODE_SEMESTER) ?>
            <?php if($detail_potongan): ?>
              <?php foreach($detail_potongan as $depot): ?>
              <tr style="color:#000">
                <td height="23" align="right">&nbsp;</td>
                <td align="left" style="padding-left:10px">&nbsp;&nbsp;&nbsp;<?php echo $depot->KETERANGAN  ?></td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td align="right" style="padding-right:5px"><?php echo number_format($depot->POTONGAN,0,'','.'); ?></td>
                <td>&nbsp;</td>
                <?php $total_potongan = $total_potongan + $depot->POTONGAN; ?>
              </tr>
              <?php endforeach ?>
            <?php endif ?>

            <?php $seq_number++; ?>
            <?php endforeach; ?>

            <?php $info = '&nbsp;' ?>

            <?php else: ?>

            <?php $info = 'Tidak ada tagihan.'; ?>

            <?php endif; ?>

            <?php $total_spp = $total_tagihan - $total_potongan; ?>

            <tr style="color:#000">
              <td height="23" colspan="3"><?php echo $info ?></td>
              <td align="right" style="padding-right:5px"><b>Total :</b></td>
              <td align="right" style="padding-right:5px"><?php if($total_potongan > $total_tagihan) echo number_format($total_spp,0,'','.'); else echo '&nbsp;'; ?></td>
              <td align="right" style="padding-right:5px"><?php if($total_potongan <= $total_tagihan) echo number_format($total_spp,0,'','.'); else echo '&nbsp;'; ?></td>
            </tr>

   </table>
</p>

<br />
</div>
</div>

</div>